﻿@model SILAS.UI.Models.CambiarPasswordUsuarioPorAdministrador
@{
    ViewBag.Title = "CambiarPassword";
    Layout = "~/Views/Shared/_layoutGeneral.cshtml";
}



    <script type="text/javascript">

        $(function () {

            $("#btnGuardar").click(function () {

                var data = $('form').serialize();

                $.post('@Url.Action("CambiarPassword", "Account")',
                         data,
                         function (ok) {
                             if (ok) {
                                 if (ok.exito == true) {
                                     alert(ok.msg);
                                     window.location = '@Url.Action("AdministrarUsuario", "Account")';
                                 }
                                 else {
                                     alert(ok.msg);
                                 }
                             }
                         }, "json");
            });

        });
       
    </script>



<p>
   Password minimo requerido es de @Membership.MinRequiredPasswordLength caracteres.
</p>
@using (Html.BeginForm()) {
   @Html.ValidationSummary(true)
   <fieldset>
       <legend>Información del Usuario</legend>

       <div class="editor-label">
           @Html.LabelFor(model => model.NombreUsuario)
       </div>
       <div class="editor-field">
           @Html.TextBoxFor(model => model.NombreUsuario, new { @readonly = "readonly" })
           @Html.ValidationMessageFor(model => model.NombreUsuario)
       </div>

       <div class="editor-label">
           @Html.LabelFor(model => model.NuevoPassword)
       </div>
       <div class="editor-field">
           @Html.EditorFor(model => model.NuevoPassword)
           @Html.ValidationMessageFor(model => model.NuevoPassword)
       </div>

        <p>
            <button id="btnGuardar" type="button">Guardar</button> 
        </p>
   </fieldset>
}